1. Field of the Invention
The present invention relates to a run length encoder for compressing and encoding video data, and more particularly to a run length encoder for outputting a (run, level) symbol when detecting a block in which all of its Discrete Cosine Transform (DCT) coefficients are zero.
2. Description of the Prior Art
In general, as the amount of information increases, and a bandwidth for transmitting the information becomes limited, there is a prevalent need for a better data compression technique in video image data transmission. Particularly, since the amount of data in a digital video signal is enormous, its data compression is necessary for efficient storage, search, and transmission.
Accordingly, there have been developed techniques for compressing video data, which remove redundancies contained in video image signals. Known techniques such as an intra frame coding and an inter frame coding remove the spatial redundancy within still image and the temporal redundancy between adjacent video frames, respectively.
Such intra frame coding comprises a DCT and a quantization steps. The inter frame coding comprises a motion estimation/compensation coding for estimating and compensating a motion between two adjacent pictures.
In addition, an entropy coding, which codes quantized DCT coefficient values, removes the statistical redundancies. This entropy coding method comprises a Run Length Coding (RLC), a Variable Length Coding (VLC), and a Bit Plane Coding (BPC). Of these entropy coding methods, the RLC and VLC are most widely used.
Here, the RLC is commonly used to increase a data compression ratio of the transform coding such as DCT. The DCT coefficients have energy distribution in which the energy is concentrated in low frequency coefficients rather than high frequency coefficients having almost `0` value. When quantized DCT coefficients are scanned in the zigzag order to be arranged from the low to the high frequency coefficients, a long 1-dimensional stream of `0`s is formed. The RLC outputs a 2-dimensional symbol, (run, level) formed by the number of consecutive `0`s and the succeeding non-zero coefficient in the data stream generated by the zigzag scanning.
Another entropy coding method, VLC, compresses a data by minimizing a bit generation ratio such that less bits are assigned to the frequent symbol and more bits are assigned to the rare symbol according to a statistical distribution of the coded symbols. The VLC comprises various types, however, a Huffman coding is commonly used.
FIG. 1 shows a schematic block diagram of a conventional video encoder which is used in a standard encoder such as H.261, MPEG-1, and MPEG-2. A DCT unit 1 processes pixels to remove redundancies between respective pixels within intra frame in 8.times.8 pixel block units, thereby obtaining DCT coefficients. A quantizer 2 quantizes the DCT coefficients to output in quantization step size. A zigzag scanning unit 3 processes the quantized DCT coefficients to yield 1-dimensional data stream to be outputted to a RLC unit 4. The RLC unit 4 codes the 1-dimensional data stream. A VLC unit 5 then codes the coded 1-dimensional data stream from the RLC unit 4 in accordance with the Huffman table, and the obtained result is outputted to a buffer (not shown).
At this moment, the RLC unit 4 outputs a DC size and a DC difference when the input data are Intra DC coefficients, whereas it outputs the 2-dimensional symbol, (run, level) comprising the number of consecutive `0`s and the succeeding non-zero coefficient when the input data are non-Intra DC coefficients.
In the RLC unit 4, a zero-run and a level value are represented as a 2-dimensional symbol, a (run, level). For example, the zigzag scanned DCT coefficients such as (30, 2, 0, 0, -8, 0, 0, 0, 9 . . . ) are coded to obtain 2-dimensional symbols such as (0, 30), (0, 2), (2, -8), (3, 9) . . . In addition, when all of the zigzag scanned coefficients are zero from a predetermined location to the end of a block, an end of block (EOB) code is added to the corresponding location.
In the zigzag scanning unit 3, a coded block pattern (cbp) signal for representing whether each block within a macro block is coded or skipped is generated and outputted to the VLC unit 5. Accordingly, in the VLC unit 5, and the block in which all of its coefficients are `0` is distinguished. For example, when the cbp signal is (0, 0, 0. 1, 0, 1) for a macro block, blocks in which all of its coefficients are `0` are the first, second, third, and fifth blocks, whereas fourth and sixth blocks contain non-zero coefficients.
As described above, the zigzag scanning unit 3 detects the blocks having all zero coefficients to generate corresponding cbp signal. In the VLC unit 5, the obtained cbp signal and blocks are processed for further data compression.
In a conventional video encoder, the cbp signal and the (run, level) value of the coded block obtained are inputted to the VLC unit, however, the (run, level) value for block containing all zero DCT coefficients are not inputted. Consequently, the coded block is indistinguishable from the non-coded block.